<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@include file="/WEB-INF/base.jspf"%>
<!DOCTYPE html>
<html>
<head>
<title>下载页面管理</title>
<style type="text/css">
	img{border:2px dashed white;}
	.d-img img{border:2px dashed red;}
	img:hover{border:2px dashed blue;}
	.title{
		font-size: 12px;
		text-align: center;
		margin: 0;
	}
	.warp{
		border: 1px solid #eee;
		margin: 2px 0;
	}
	.warp img{
		max-height: 600px;
	}
</style>
</head>
<body style="padding-left: 14vw">
<div style="width:100%;overflow: hidden;border:2px solid red;margin: 10px;padding:5px;">
	<h4 style='text-align: center;'>手机端图片</h4>
	<div style="width:24vw;float:left;border:1px solid #999;">
		<h5 style='text-align: center'>下载页面轮播图</h5>
		<div class='warp'>
			<p class='title'>轮播图1</p>
			<img dataName="file1" src="/d/cp/${app.img_path_1}" style="width:100%;">
		</div>
		<div class='warp'>
			<p class='title'>轮播图2</p>
			<img dataName="file2" src="/d/cp/${app.img_path_2}" style="width:100%;">
		</div>
		<div class='warp'>
			<p class='title'>轮播图3</p>
			<img dataName="file3" src="/d/cp/${app.img_path_3}" style="width:100%;">
		</div>
	</div>
	
	<div style="width:24vw;float:left;border:1px solid #999;margin-left: 20px;">
		<h5 style='text-align: center'>下载页面图</h5>
		<div class='warp'>
			<p class='title'>下载图1</p>
			<img dataName="file4" id='accessaddress' src="/d/cp/${app.img_path_4}" style="width:100%;">
		</div>
		<div class='warp'>
			<p class='title'>下载图2</p>
			<img dataName="file5" src="/d/cp/${app.img_path_5}" style="width:100%;">
		</div>
		<div class='warp'>
			<h5 style='text-align: center'>下载图标</h5>
			<img dataName="ios_path" id='ios' src="/img/ios1.png" style="width:48%;margin: 2px 0;border: 1px solid #d2d2d2">
			<img dataName="app_path" id='Android' src="/img/and.png" style="width:48%;margin: 2px 0;border: 1px solid #d2d2d2">
		</div>
	</div>
</div>

<div style='width:100%;overflow: hidden;border:2px solid red;margin: 10px;padding:5px;' class='warp'>
	<h4 style='text-align: center;'>PC端图片</h4>
	<div style="width:24vw;float:left;border:1px solid #999;">
		<h5 style='text-align: center'>下载二维码图</h5>
		<div class='warp'>
			<p class='title'>Iphone图</p>
			 <img dataName="file6" src="/d/cp/${app.android_img}" style="width:100%;">
		</div>
	   <div class='warp'>
			<p class='title'>Android图</p>
			  <img dataName="file7" src="/d/cp/${app.ios_img}" style="width:100%;">
		</div>
	</div>
	
	 <div style="width:24vw;float:left;border:1px solid #999;margin-left: 20px;" class='warp'>
		<h5 style='text-align: center'>首页背景图</h5>
		<img dataName="file8" src="/d/cp/${app.pc_img}" style="width:100%;">
	</div> 
	
	 <div style="width:24vw;float:left;border:1px solid #999;margin-left: 20px;" class='warp'>
		<h5 style='text-align: center'>手机购彩页面背景图</h5>
		<img dataName="file9" src="/d/cp/${app.gc_img}" style="width:100%;">
	</div> 
	
	 <div style="width:24vw;float:left;border:1px solid #999;margin-left: 20px;margin-top: 20px;" class='warp'>
		<h5 style='text-align: center'>购彩大厅页面背景图</h5>
		<img dataName="file10" src="/d/cp/${app.download_img}" style="width:100%;">
	</div> 
</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content" style="width: 300px;left:30%;top:200px;">
            <div class="modal-body">
            	<form action="/admin/updateAppDownloadSetup.do" enctype="multipart/form-data" method="post">
					<input name="ids" value="1" hidden />
					<div id="i-item" style="margin-bottom: 20px;">
					
					</div>
					<div style="text-align: center">
						<button type="submit" class="btn btn-primary glyphicon glyphicon-ok"></button><span>　</span>
						<button type="button" class="btn btn-default glyphicon glyphicon-remove" data-dismiss="modal"></button>
					</div>
				</form>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">


$("img").on("click",function(){
	var dataName=$(this).attr("dataName")
	var html="<input style='width:100%; height:35px;' "
	if(dataName.indexOf("file")!=-1){
		if(dataName.indexOf("file4")!=-1){
			html+="type='text' placeholder='输入访问链接'   name='content'/><br><input  style='width:100%; margin-top:20px;' type='file' accept='.png,.jpg'"
		}else{	
			html+="type='file' accept='.png,.jpg'"
		}
	}else{
		html+="placeholder='输入下载链接' ";
	}
	html+=" name='"+dataName+"' />"
	$("#i-item").html(html)
	$("#myModal").modal("show")
}) 

 $("#accessaddress").on("click",function(){
	var dataName=$(this).attr("dataName")
	var html="<input id='lianjie' style='width:100%; height:35px;' "
	if(dataName.indexOf("file")!=-1){
		if(dataName.indexOf("file4")!=-1){
			html+="type='text' placeholder='输入访问链接'   name='content'/><br><input  style='width:100%; margin-top:20px;' type='file' accept='.png,.jpg'"
		}else{	
			html+="type='file' accept='.png,.jpg'"
		}
	}else{
		html+="placeholder='输入下载链接' ";
	}
	html+=" name='"+dataName+"' />"
	$("#i-item").html(html)
	$("#myModal").modal("show")
	$.ajax({
		  url: "/admin/findAppDownloadInfo.do",
		  type: "post",
		  data: {},
		  success:function(data){
		  	$("#lianjie").val(data.data.content)
		  },
	})			
}) 
	$("#ios").on("click",function(){
		var dataName=$(this).attr("dataName")
		var html="<input id='iosConnect' style='width:100%; height:35px;' "
		if(dataName.indexOf("file")!=-1){
			if(dataName.indexOf("file4")!=-1){
				html+="type='text' placeholder='输入访问链接' name='content'/><br><input style='width:100%; margin-top:20px;' type='file' accept='.png,.jpg'"
			}else{	
				html+="type='file' accept='.png,.jpg'"
			}
		}else{
			html+="placeholder='输入下载链接' ";
		}
		html+=" name='"+dataName+"' />"
		$("#i-item").html(html)
		$("#myModal").modal("show")
		$.ajax({
			  url: "/admin/findAppDownloadInfo.do",
			  type: "post",
			  data: {},
			  success:function(data){
			  	$("#iosConnect").val(data.data.ios_path)
			  },
		})			
	})
	
	
	$("#Android").on("click",function(){
		var dataName=$(this).attr("dataName")
		var html="<input id='AndroidConnect' style='width:100%; height:35px;' "
		if(dataName.indexOf("file")!=-1){
			if(dataName.indexOf("file4")!=-1){
				html+="type='text' placeholder='输入访问链接'   name='content'/><br><input  style='width:100%; margin-top:20px;' type='file' accept='.png,.jpg'"
			}else{	
				html+="type='file' accept='.png,.jpg'"
			}
		}else{
			html+="placeholder='输入下载链接' ";
		}
		html+=" name='"+dataName+"' />"
		$("#i-item").html(html)
		$("#myModal").modal("show")
		$.ajax({
			  url: "/admin/findAppDownloadInfo.do",
			  type: "post",
			  data: {},
			  success:function(data){
			  	$("#AndroidConnect").val(data.data.android_path)
			  },
		})			
	})
	
</script>
</body>
</html>